<?php
namespace Admin\Model;
use Think\Model;

class CommonModel extends Model{
	protected $autoCheckFields = false;
	
	//数据表信息
	public function info(){
		return $this->query("SHOW TABLE STATUS FROM `".C('DB_NAME')."` LIKE '__PREFIX__%'");
	}
	
	//优化数据表
	public function optimizeTable($table){
		return $this->execute("OPTIMIZE TABLE `$table`");
	}
	 
	//修复Autoindex
	public function repairAutoindex($table){
		return $this->execute("ALTER TABLE `$table` AUTO_INCREMENT=1");
	}
}